
function createLayoutForBrowse()
{
	
	pageLayout = $("#contentDiv").layout({
	     west__paneSelector:	"#browseOptionSide"
		,center__paneSelector:	"#browseResultSide"
		,spacing_open: 			5 
		,spacing_closed: 		5
		,resizable: 			false
		,west__size:			440
		
	});
	
var dialogatt = $("#docDtlsDialogue").dialog({
		
		height: 550,
		width: 950,
		modal: true,
		zIndex: 8999,
		autoOpen: false
		
		
	});
browse();
	
}
function browse()
{
	$.getJSON("browse.htm",{strLevel:1,strValue:0},function(data){
		
		/*var options='';
		 $.each(data, function(key, val) {
			 options += '<tr><td align="center"><a href="browseBu('+key+')">'+ val + '</a></td><td align="left"></td></tr>';
			//options+.push('<li id="' + key + '">' + val + '</li>');
			  });
*/
		 var options ='';
	      for (var i = 0; i < data.length; i++) {
	        options += '<tr><td align="center" class="ui-widget-header"><a href="javascript:browseBu('+data[i].key+')">'+ data[i].value + '</a></td></tr>';
	      }
	      $("#browseOptions").html(options);
	      
	    },"html");
}

function accessDocFrmId(docID)
{
	
	
	
	var url="accessDocDtlsFrmId.htm";
	$.post(url,{docID:docID},function(data){
		$("#docDtlsDialogue").empty().html(data);
		
		
		 
		$("#docDtlsDialogue").dialog("open");
		
	},"html");
}

function browseBu(strValue)
{
	$.getJSON("browse.htm",{strLevel:2,strValue:strValue},function(data){
		
		 var options ='';
	      for (var i = 0; i < data.length; i++) {
	        options += '<tr><td align="center" class="ui-widget-header"><a href="javascript:browseDept('+data[i].key+')">'+ data[i].value + '</a></td></tr>';
	      }
	      $("#browseOptions").html(options);
	      
	    },"html");
}
function browseDept(strValue)
{
	$.getJSON("browse.htm",{strLevel:3,strValue:strValue},function(data){
		
		 var options ='';
	      for (var i = 0; i < data.length; i++) {
	        options += '<tr><td align="center" class="ui-widget-header"><a href="javascript:browseDoc('+data[i].key+')">'+ data[i].value + '</a></td></tr>';
	      }
	      $("#browseOptions").html(options);
	      
	    },"html");
}
function browseDoc(strValue)
{
	$.getJSON("browse.htm",{strLevel:4,strValue:strValue},function(data){
		
		 var options ='';
	      for (var i = 0; i < data.length; i++) {
	        options += '<tr><td align="center" class="ui-widget"><a href="javascript:accessDocFrmId('+data[i].key+')">'+ data[i].value + '</a></td><td align="left">'+data[i].display+'</td></tr>';
	      }
	      $("#browseResultBody").html(options);
	      
	    },"html");
	
}



	


